<script>
	$(document).ready(function(){
		
		$('#kd_fakultas').change(function(){
			$('#kd_prodi').load(base_url+'prosedur/getProdibyFakultas/'+$('#kd_fakultas').val());
		});
		
		$('#kd_prodi').change(function(){
			$('#kd_kurikulum').load(base_url+'prosedur/getKurikulumbyProdi/'+$('#kd_prodi').val());
		});
		
		$('#kd_kurikulum').change(function(){
			$('#mk_prasyarat').load(base_url+'prosedur/getMatakuliah/'+$('#kd_kurikulum').val());
		});
	});
</script>

<form id="form1" method="post" style="margin:10px;">
	<input type="hidden" name="kode" id="kode" value="<?=$kode?>">
	<div class="fitem" >
		<label style="width:100px">Fakultas </label>:
		<select id="kd_fakultas" name="kd_fakultas" style="width:290px;">
			<?=$this->mdl_prosedur->OptionFakultas(array('value'=>$kd_fakultas));?>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px">Prodi </label>:
		<select id="kd_prodi" name="kd_prodi" style="width:290px;">
			<?=$this->mdl_prosedur->OptionProdi(array('value'=>$kd_prodi, 'kd_fakultas'=>$kd_fakultas));?>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px">Kurikulum </label>:
		<select id="kd_kurikulum" name="kd_kurikulum" style="width:200px;">
			<?=$this->mdl_prosedur->OptionKurikulum(array('kd_prodi'=>$kd_prodi, 'value'=>$kd_kurikulum));?>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px">Jenis MK </label>:
		<select id="kd_jenismk" name="kd_jenismk" style="width:100px;">
			<?=$this->mdl_prosedur->OptionJenisMK(array('value'=>$kd_jenismk));?>
		</select>
	</div>
		<div class="fitem" >
		<label style="width:100px">Kelompok MK </label>:
		<select id="kd_kelompokmk" name="kd_kelompokmk" style="width:100px;">
			<?=$this->mdl_prosedur->OptionKelompokMK(array('value'=>$kd_kelompokmk));?>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px">Kode MK </label>:
		<input name="kd_matakuliah" size="10" required="true" value="<?=$kd_matakuliah?>">
	</div>
	<div class="fitem" >
		<label style="width:100px">Nama MK </label>:
		<input name="nama_matakuliah" size="40" required="true" value="<?=$nama_matakuliah?>">
	</div>
	<div class="fitem" >
		<label style="width:100px">SKS </label>:
		<input name="sks" size="5" required="true" value="<?=$sks?>">
	</div>
	<div class="fitem" >
		<label style="width:100px">Semester </label>:
		<select id="semester" name="semester" style="width:150px;">
			<option value="" > - Pilih Semeseter - </option>
			<option value="1" <?=$semester=='1'?'Selected="selected"':'';?>>1</option>
			<option value="2" <?=$semester=='2'?'Selected="selected"':'';?>>2</option>
			<option value="3" <?=$semester=='3'?'Selected="selected"':'';?>>3</option>
			<option value="4" <?=$semester=='4'?'Selected="selected"':'';?>>4</option>
			<option value="5" <?=$semester=='5'?'Selected="selected"':'';?>>5</option>
			<option value="6" <?=$semester=='6'?'Selected="selected"':'';?>>6</option>
			<option value="7" <?=$semester=='7'?'Selected="selected"':'';?>>7</option>
			<option value="8" <?=$semester=='8'?'Selected="selected"':'';?>>8</option>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px">Prasyarat MK </label>:
		<select id="mk_prasyarat" name="mk_prasyarat" style="width:290px;">
			<?=$this->mdl_prosedur->OptionMatakuliah(array('kd_kurikulum'=>$kd_kurikulum, 'value'=>$mk_prasyarat));?>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px">Ditawarkan </label>:
		<select id="ditawarkan" name="ditawarkan" style="width:150px;">
			<option value="" > - Pilih Status - </option>
			<option value="Y" <?=$ditawarkan=='Y'?'Selected="selected"':'';?>>Ditawarkan</option>
			<option value="T" <?=$ditawarkan=='T'?'Selected="selected"':'';?>>Tidak Ditawarkan</option>
		</select>
	</div>
	<div class="fitem" >
		<label style="width:100px">Status</label>:		
		<input type="checkbox" name="status" <?=$status=='A'?'checked':''?>/> Aktif
	</div>
</form>
	

